import 'package:flutter/material.dart';

class BoxContainer extends StatelessWidget {
  const BoxContainer({
    Key? key,
    required this.onTap,
    required this.boxWidth,
    required this.boxHeight,
    this.boxColor = Colors.white,
    required this.boxShadowColor,
    required this.icon,
    required this.contentText,
    required this.contentTitle,
    this.crossAxisAlignment = CrossAxisAlignment.start,
    this.contentCrossAxisAlignment = CrossAxisAlignment.start,
    this.contentLeft = 0,
    this.mainAxisAlignment = MainAxisAlignment.start,
    this.contentTitleStyle,
    this.contentTextStyle,
  }) : super(key: key);

  final GestureTapCallback? onTap;
  final double? boxWidth;
  final double? boxHeight;
  final Color? boxColor;
  final Color boxShadowColor;
  final Widget? icon;
  final String? contentText;
  final String? contentTitle;
  final double? contentLeft;
  final CrossAxisAlignment? crossAxisAlignment;
  final CrossAxisAlignment? contentCrossAxisAlignment;
  final MainAxisAlignment? mainAxisAlignment;
  final TextStyle? contentTitleStyle;
  final TextStyle? contentTextStyle;

  @override
  Widget build(BuildContext context) {
    return InkWell(
      onTap: onTap,
      child: Ink(
        width: boxWidth,
        height: boxHeight,
        decoration: BoxDecoration(
          borderRadius: BorderRadius.circular(14.0),
          color: boxColor,
          boxShadow: [
            BoxShadow(
              color: boxShadowColor,
              offset: const Offset(-1.0, 5.0),
              blurRadius: 13.0,
            ),
          ],
        ),
        child: Column(
          crossAxisAlignment: crossAxisAlignment!,
          mainAxisAlignment: mainAxisAlignment!,
          children: <Widget>[
            Container(
              margin: EdgeInsets.only(
                left: contentLeft!,
              ),
              child: Column(
                crossAxisAlignment: contentCrossAxisAlignment!,
                children: <Widget>[
                  icon!,
                  const SizedBox(
                    height: 8.0,
                  ),
                  Text(
                    contentTitle!,
                    style: contentTitleStyle,
                  ),
                  const SizedBox(
                    height: 8.0,
                  ),
                  Text(
                    contentText!,
                    style: contentTextStyle,
                  ),
                ],
              ),
            ),
          ],
        ),
      ),
    );
  }
}
